﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LGCourt.Logic.BLL;
using LGCourt.Logic.NBL.DBEntities;

namespace lgweb.judicial
{
    public partial class result : System.Web.UI.Page
    {
        private string _AH = string.Empty;
        private string _User = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                GetParam();
                GetLAXX();
            }
        }

        private void GetParam()
        {
            this._AH = string.IsNullOrEmpty(Request.QueryString["ah"]) ? "" : Request.QueryString["ah"];
            this._User = string.IsNullOrEmpty(Request.QueryString["user"]) ? "" : Request.QueryString["user"];

            if (string.IsNullOrEmpty(this._AH) || string.IsNullOrEmpty(this._User))
            {
                this.divSearch.Visible = true;
                //Response.Redirect("/index.aspx");
            }
        }


        private void GetLAXX()
        {
            CaseQuery bll = new CaseQuery();

            pLAXX result = (pLAXX)bll.GetLAXX(this._AH,this._User);

            if (result != null)
            {
                this.appAHInfo.InnerHtml = result.AH + " 案件详情";
                this.tdAH.InnerHtml = result.AH;
                this.tdAJJZJD.InnerHtml = result.AJJZJD;
                this.tdAJLX.InnerHtml = result.AJLX;
                this.tdKTDD.InnerHtml = result.KTDD;
                this.tdKTRQ.InnerHtml = result.KTRQ.Value.ToShortDateString();
                this.tdLAAY.InnerHtml = result.LAAY;
                this.tdYear.InnerHtml = result.AH.Substring(1, 4);
                this.divSearch.Visible = false;
                this.divApp.Visible = true;
                this.divInfo.Visible = false;
            }
            else
            {
                this.ahinfo.InnerHtml = this._AH + " 案件详情";
                this.divSearch.Visible = true;
                this.divApp.Visible = false;
                this.divInfo.Visible = true;
            }

        }


    }
}